﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;


/// <summary>
/// 阵型中的单位，建立起阵型槽与移动脚本之间的联系
/// </summary>


namespace Formation
{
    
    //public class FormationUnitSlot
    //{
        
    //    public FormationUnit unit;
    //    public FormationSlot slot;
    //    public bool isOccupied
    //    {
    //        get
    //        {
    //            return unit != null && unit.isValid;
    //        }

    //    }
    //    public FormationUnitSlot(FormationUnit unit, FormationSlot slot)
    //    {
    //        this.unit = unit;
    //        this.slot = slot;
    //    }
    //    public FormationUnitSlot(FormationSlot slot)
    //    {
    //        this.slot = slot;
    //    }
    //}

    public class FormationUnit
    {
        public SoldierAI unit;
        public string tag;

        public bool IsValid
        {
            get { return unit != null; }
        }

        public FormationUnit(SoldierAI unit, string tag)
        {
            this.unit = unit;
            this.tag = tag;
        }
    }

    /// <summary>
    /// 阵型槽，其中tag可能被某些阵型
    /// </summary>
    public class FormationSlot
    {
        public Vector3 position;
        public Quaternion rotation;
        public string tag;
        public int id; //这个slot在生成的阵型中的id

        public FormationSlot(Vector3 pos, Quaternion rot, int id)
        {
            this.position = pos;
            this.rotation = rot;
            this.id = id;
        }



    }
}
